import Vue from 'vue';
import VueRouter from 'vue-router';

const Index = () => import('@/pages/index.vue');
const Feature = () => import('@/pages/feature.vue');
const Solution = () => import('@/pages/solution.vue');

Vue.use(VueRouter);

export const routes = [
  {
    path: '/',
    name: 'index',
    alias: '首页',
    title: 'Discuz! Q - 再小众，也有圈子 - 开源的PHP内容付费轻社区',
    component: Index,
  },
  {
    path: '/feature',
    name: 'feature',
    alias: '特性',
    title: '特性 - Discuz! Q',
    component: Feature,
  },
  {
    path: '/solution',
    name: 'solution',
    alias: '解决方案',
    title: '解决方案 - Discuz! Q',
    component: Solution,
  },
];

export const router = new VueRouter({
  mode: 'history',
  routes: [
    ...routes,
    {
      path: '*',
      redirect: {
        name: 'index',
      },
    },
  ],
});
